package network.enums;

public enum ServerPackets { GameList(0), ChannelList(1), Ping(3), Login(4), Register(5),
	UserList(6), FriendList(7), ChatMessage(8), JoinChannel(9), LeaveChannel(10), TeamList(11),
	AddFriend(12), RemoveFriend(13), RequestDuel(14), AcceptDuel(15), RefuseDuel(16),
	DevPoints(17), ChatCommand(18), DevPointCommand(19), TournamentList(20), TournamentStart(21),
	TournamentJoin(22), TournamentLeave(23), TournamentIsReady(24);
private int value;

private ServerPackets(int value) 
{
        this.value = value;
}
public int getValue()
{
	return value;
}
public static ServerPackets fromInt(int code) {
	
	switch(code) 
	{
		case 0:
			return GameList;
		case 1:
			return ChannelList;
		case 3:
			return Ping;
		case 4:
			return Login;
		case 5:
			return Register;
		case 6:
			return UserList;
		case 7:
			return FriendList;
		case 8:
			return ChatMessage;
		case 9:
			return JoinChannel;
		case 10:
			return LeaveChannel;
		case 11:
			return TeamList;
		case 12:
			return AddFriend;
		case 13:
			return RemoveFriend;
		case 14:
			return RequestDuel;
		case 15:
			return AcceptDuel;
		case 16:
			return RefuseDuel;
		case 17:
			return DevPoints;
		case 18:
			return ChatCommand;
		case 19:
			return DevPointCommand;
		case 20:
			return TournamentList;
		case 21:
			return TournamentStart;
		case 22:
			return TournamentJoin;
		case 23:
			return TournamentLeave;
		case 24:
			return TournamentIsReady;
		}
	return null;
}

}
